There are conventionally battery controllers with a function of detecting the spontaneous change of a threshold for detecting overcharging and/or overdischarging of a battery, as an example of which is proposed in a first patent document. Specifically, this structure disclosed in the first patent document is to detect the voltage of a battery, and compare the detected voltage with the threshold.
When comparing the battery voltage with the threshold, this structure forcibly shifts the threshold from its original value by a constant value, that is, switches the threshold in one step. Then, the voltage controller determines that there is a great spontaneous change in the threshold when the magnitude relation between the threshold and the battery voltage is not reversed irrespective of the forcible shift of the threshold. This makes it possible to detect the characteristic shift of the threshold.